package com.gxkj.movie.threads;

import com.alibaba.fastjson.JSON;
import com.gxkj.movie.helpers.BaiduSpiderHelper;
import lombok.extern.slf4j.Slf4j;

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * @author sqyc
 */
@Slf4j
public class BaiduSubmitUrlThread implements Runnable{

    BaiduSpiderHelper baiduSpiderHelper;

    String[] param ;

    public BaiduSubmitUrlThread(BaiduSpiderHelper baiduSpiderHelper, String[] param) {
        this.baiduSpiderHelper = baiduSpiderHelper;
        this.param = param;
    }

    @Override
    public void run() {
        String res = baiduSpiderHelper.Post(param);
        DateFormat df1 = null ;     // 声明一个DateFormat

        df1 = DateFormat.getDateInstance(DateFormat.YEAR_FIELD,new Locale("zh","CN")) ; // 得到日期的
        log.info( df1.format(new Date())+"  提交百度param="+JSON.toJSONString(param)+",返回结果为："+res);
    }
}
